<?php
/**
 * Author: ngreduce
 * Date: 05.03.11
 * Time: 13:00
 */

$this->breadcrumbs=array(
    Yii::t('mj-base', 'Jobs')=>$this->createUrl('job/index'),
	$model->title,
);
$this->pageTitle=$model->title;
?>

<?php $this->renderPartial('_view', array(
	'data'=>$model,
)); ?>

<div id="comments">
	<?php if($model->requestCount>=1 and $model->showRequests): ?>
		<h3>
			<?php echo Yii::t('mj-base', 'One request|{n} requests', array($model->requestCount));?>
		</h3>

		<?php
                $this->renderPartial('_requests',array(
                    'job'=>$model,
                    'requests'=>$model->requests,
                ));
		?>
	<?php endif; ?>

	<h3><?php echo Yii::t('mj-base', 'Leave Request');?></h3>

	<?php if(Yii::app()->user->hasFlash('requestSubmitted')): ?>
		<div class="flash-success">
			<?php echo Yii::app()->user->getFlash('requestSubmitted'); ?>
		</div>
	<?php else: ?>
		<?php $this->renderPartial('/request/_form',array(
			'model'=>$request,
		)); ?>
	<?php endif; ?>

</div><!-- requests -->
